package com.atguigu.exam;

import java.util.Scanner;

/**
 * @author xbd
 * @create 2021-05-26 21:32
 */
public class PrintWeekTest {
    public static void main(String[] args) {
        System.out.print("请输入星期数：");
        Scanner scanner = new Scanner(System.in);
        String w1 = scanner.nextLine();

        int n = Integer.parseInt(w1);
        TestWeek tw = new TestWeek();

        switch (n){
            case 1:
                tw.printWeek(Weeks.MONDAY);
                break;
            case 2:
                tw.printWeek(Weeks.TUESDAY);
                break;
            case 3:
                tw.printWeek(Weeks.WEDNESDAY);
                break;
            case 4:
                tw.printWeek(Weeks.THURSDAY);
                break;
            case 5:
                tw.printWeek(Weeks.FRIDAY);
                break;
            case 6:
                tw.printWeek(Weeks.SATURDAY);
                break;
            case 7:
                tw.printWeek(Weeks.SUNDAY);
                break;
            default:
                System.out.println("输入数据错误");
        }
    }
}

class TestWeek{
    public void printWeek(Weeks weeks){
        System.out.println(weeks.getDesc());
    }
}

enum Weeks{
    MONDAY("星期一"),
    TUESDAY("星期二"),
    WEDNESDAY("星期三"),
    THURSDAY("星期四"),
    FRIDAY("星期五"),
    SATURDAY("星期六"),
    SUNDAY("星期七");

    private final String desc;

    private Weeks(String desc) {
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }
}